package com.example.togethermove.ui.activity.mine;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.togethermove.R;
import com.example.togethermove.base.BaseActivity;
import com.example.togethermove.base.BaseActivityone;
import com.example.togethermove.ui.activity.login.LoginActivity;
import com.example.togethermove.ui.activity.togetherMove.SportSettingActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

//设置
public class SettingActivity extends BaseActivity {

    @BindView(R.id.iv_headLeft)
    ImageView ivHeadLeft;
    @BindView(R.id.tv_headTitle)
    TextView tvHeadTitle;
    @BindView(R.id.iv_headRight)
    ImageView ivHeadRight;
    @BindView(R.id.tv_headRight)
    TextView tvHeadRight;

    @BindView(R.id.lin_setting_address)//我的收货地址
    LinearLayout lin_setting_address;
    @BindView(R.id.lin_setting_person)//个人资料
   LinearLayout lin_setting_person;
    @BindView(R.id.lin_setting_safe)//账号安全
    LinearLayout lin_setting_safe;
    @BindView(R.id.lin_setting_sports)//运动设置
    LinearLayout lin_setting_sports;
    @BindView(R.id.lin_setting_message)//消息提醒
    LinearLayout lin_setting_message;
    @BindView(R.id.lin_setting_universal)//通用设置
    LinearLayout lin_setting_universal;
    @BindView(R.id.lin_setting_invite_)//好友邀请
    LinearLayout lin_setting_invite_;
    @BindView(R.id.lin_setting_feed_back)//用户反馈
    LinearLayout lin_setting_feed_back;
    @BindView(R.id.tv_setting_exit)//退出登陆
    TextView tv_setting_exit;
    @BindView(R.id.im_round)//用户头像
    ImageView im_round;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);

        ButterKnife.bind(this);
        tvHeadTitle.setText("设置");


    }


    @OnClick({R.id.iv_headLeft,R.id.lin_setting_address,R.id.lin_setting_feed_back,R.id.lin_setting_invite_,
            R.id.lin_setting_message,R.id.lin_setting_person,R.id.lin_setting_safe,R.id.lin_setting_sports,
            R.id.lin_setting_universal,R.id.tv_setting_exit
    })
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.iv_headLeft:
                finish();
                break;
            case R.id.lin_setting_address:
                toNewActivity(MyAddressActivity.class);
                break;
            case R.id.lin_setting_person:
                toNewActivity(DataPersonActivity.class);
                break;
            case R.id.lin_setting_safe:
                toNewActivity(AccountSafeActivity.class);
                break;
            case R.id.lin_setting_sports:
                toNewActivity(SportSettingActivity.class);
                break;
            case R.id.lin_setting_message:
                toNewActivity(RemindSportsActivity.class);
                break;
            case R.id.lin_setting_universal: //通用设置没有

                break;
            case R.id.lin_setting_invite_:  //弹个lalog
                toNewActivity(DataPersonActivity.class);
                finish();
                break;
            case R.id.lin_setting_feed_back://用户反馈
                finish();

                break;
            case R.id.tv_setting_exit://退出登陆
                toNewActivity(LoginActivity.class);//返回到登陆界面
                finish();
//                if (ConfigUtil.isLogin()) {
//                    new TwoChooseDialog(mContext).setDialogTitle("退出登录")
//                    .setDialogSubTitle("是否退出登录")
//                    .setConfirm("确定")
//                    .setCancel("取消")
//                    .setFunction(new Function<Integer, Void>() {
//                        @Override
//                        public Void apply(Integer o) {
//                            if (o == 0)
//                                return null;
//                            ConfigUtil.setIsLogin(false);
//                            HttpConfigUtil.saveRefreshToken("");
//                            HttpConfigUtil.saveToken("");
//                            ConfigUtil.setMemberId(new LoginRData.LoginMemberInfoBo());
////                                    SPUtils.clearAllData();
//                            RxBus.getInstance().post(new LoginRData());
//                            MyApp.getCustomApp().mainSwitchPage(0);//跳转到首页界面
//                            finish();
//                            return null;
//                        }
//                    }).show();
//        } else {
//            showToast("未登录!");
//        }
//                break;
      }
    }


}